import Mock from "mockjs";
const Random = Mock.Random;
export const loginData = Mock.mock("/mock/login", "post", {
    'code|1': [200, 500],
    message: function() {
      return this.code === 200 ? '登录成功' : '登录失败，请检查用户名和密码';
    },
    data: function() {
      return {
        user: this.code === 200 ? {
          name: Random.name()
        } : null,
        token: this.code === 200 ? Random.string(80) : null
      }
    }
});